using System;
using System.Linq;
using System.Diagnostics.Contracts;

namespace FoundationLib.Mail 
{
	/// <summary>
	/// Abstract superclass for mail data items.
	/// </summary>
	public abstract class MailDataItem 
	{
		/// <summary>
		/// The data item key
		/// </summary>
		private string key;


		/// <summary>
		/// Creates a new mail data item.
		/// </summary>
		/// <exception cref="ArgumentNullException">A null-reference was passed.
		/// </exception>
		/// <param name="key">The mail data item key</param>
		protected MailDataItem(string key)
		{
			Contract.Requires(!String.IsNullOrEmpty(key));
			this.key = key;
		}

		/// <summary>
		/// Gets the data item key.
		/// </summary>
		public virtual string Key
		{
			get
			{
				return this.key;
			}
		}

	}

}